<html>
<head>
    <title></title>
    <link rel="stylesheet" href="${request.contextPath}/static/css/css.css">
</head>
<body>


[#if msg??]
    <div class="message">${msg!}</div>
[/#if]


[@shiro.hasPermission name="role:create"]
    <a href="${request.contextPath}/role/create">角色新增</a><br/>
[/@shiro.hasPermission]
<table class="table">
    <thead>
        <tr>
            <th>角色名称</th>
            <th>角色描述</th>
            <th>拥有的资源</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        [#list roleList  as role]
            <tr>
                <td>${role.role}</td>
                <td>${role.description}</td>
                <td>${(organization().resourceNames(role.resourceIds))!}</td>
                <td>
                    [@shiro.hasPermission name="role:update"]
                        <a href="${request.contextPath}/role/${role.id}/update">修改</a>
                    [/@shiro.hasPermission]

                    [@shiro.hasPermission name="role:delete"]
                        <a href="${request.contextPath}/role/${role.id}/delete">删除</a>
                   [/@shiro.hasPermission]
                </td>
            </tr>
         [/#list]
    </tbody>
</table>

</body>
</html>